<?php
require_once 'XML/Feed/Parser.php';

/**
 * 유틸리티 - XML Feed Parser(ATOM/RSS/... 지원)
 *
 * <code>
 * $sRssXmlUrl = 'http://media.daum.net/rss/today/primary/all/rss2.xml';
 * $aCurlParams = array(
 *     'url'    => $sRssXmlUrl,
 *     'method'    => 'GET',
 *     'timeout'    => 5
 * );
 * $utilCurl = utilCurl::getInstance();
 * $utilCurl->init($aCurlParams);
 * $aCurlResult = $utilCurl->exec();
 * $sRss20XmlContent = $aCurlResult['body'];
 * $XML_Feed_Parser_RSS2 = utilXmlfeed::getReader($sRss20XmlContent);
 * </code>
 *
 * 참고 : 이 유틸리티는 XML/Feed/Parser.php(XML_FEED_Parser 1.0.4) 를 참조합니다.
 *
 * 샘플 : http://pear.php.net/manual/en/package.xml.xml-feed-parser.php
 *
 * @link http://pear.php.net/package/XML_Feed_Parser
 *
 * @package util
 *
 * @author jylee3@simplexi.com
 * @version 1.0
 */
class utilXmlfeed extends XML_Feed_Parser
{
    /**
     * Xml Feed Instance
     *
     * <code>
     * $XML_Feed_Parser_RSS2 = utilXmlfeed::getReader($sRss20XmlContent);
     * </code>
     *
     * @param    String    $sFeedXml
     * @param    Boolean    $bStrict
     * @param    Boolean $bSuppressWarnings
     * @param    Boolean $bTidy
     *
     * @return    XML_Feed_Parser_Atom | XML_Feed_Parser_RSS09 | XML_Feed_Parser_RSS1 | XML_Feed_Parser_RSS11 | XML_Feed_Parser_RSS2
     */
    public static function getReader($sFeedXml, $bStrict=false, $bSuppressWarnings=false, $bTidy = false)
    {
        return utilSplClass::load('utilXmlfeed', array($sFeedXml, $bStrict, $bSuppressWarnings, $bTidy));
    }
}
